﻿using System;
using System.ComponentModel;
using System.Drawing;

namespace HML
{
    /// <summary>
    /// DropDownListPlus选项绘制前事件参数
    /// </summary>
    public class DropDownListPlusDrawItemBeforeEventArgs : CancelEventArgs
    {
        private readonly float dpi;
        /// <summary>
        /// 系统缩放比例
        /// </summary>
        public float Dpi
        {
            get { return this.dpi; }
        }

        private readonly Graphics graphics;
        /// <summary>
        /// 封装一个 GDI+ 绘图图面（可绘制区域为:ClipContentBounds）
        /// </summary>
        public Graphics Graphics
        {
            get { return this.graphics; }
        }

        private readonly RectangleF clipContentBounds;
        /// <summary>
        /// 自定义按钮Rectangle（排除非剪辑区）（只包含:内容）
        /// </summary>
        public RectangleF ClipContentBounds
        {
            get { return this.clipContentBounds; }
        }

        private readonly DropDownListPlusItem item;
        /// <summary>
        /// 当前选项
        /// </summary>
        public DropDownListPlusItem Item
        {
            get { return this.item; }
        }

        private readonly bool selected;
        /// <summary>
        /// 是否选中选项
        /// </summary>
        public bool Selected
        {
            get { return this.selected; }
        }

        private readonly bool mouseEnter;
        /// <summary>
        /// 鼠标是否进入选项
        /// </summary>
        public bool MouseEnter
        {
            get { return this.mouseEnter; }
        }

        private readonly Rectangle imageRectangle;
        /// <summary>
        /// 选项图片Rectangle
        /// </summary>
        public Rectangle ImageRectangle
        {
            get { return this.imageRectangle; }
        }

        private readonly Rectangle textRectangle;
        /// <summary>
        /// 选项文本Rectangle
        /// </summary>
        public Rectangle TextRectangle
        {
            get { return this.textRectangle; }
        }

        private readonly SolidBrush backBrush;
        /// <summary>
        /// 选项背景色画笔
        /// </summary>
        public SolidBrush BackBrush
        {
            get { return this.backBrush; }
        }

        private readonly SolidBrush foreBrush;
        /// <summary>
        /// 选项前景色画笔
        /// </summary>
        public SolidBrush ForeBrush
        {
            get { return this.foreBrush; }
        }

        private readonly Pen splitterPen;
        /// <summary>
        /// 选项分隔线画笔
        /// </summary>
        public Pen SplitterPen
        {
            get { return this.splitterPen; }
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dpi">当前选项</param>
        /// <param name="graphics">封装一个 GDI+ 绘图图面（可绘制区域为:ClipContentBounds）</param>
        /// <param name="clipContentBounds">自定义按钮Rectangle（排除非剪辑区）（只包含:内容）</param>
        /// <param name="item">当前选项</param>
        /// <param name="selected">是否选中选项</param>
        /// <param name="mouseEnter">鼠标是否进入选项</param>
        /// <param name="imageRectangle">选项图片Rectangle</param>
        /// <param name="textRectangle">选项文本Rectangle</param>
        /// <param name="backBrush">选项背景色画笔</param>
        /// <param name="foreBrush">选项前景色画笔</param>
        /// <param name="splitterPen">选项分隔线画笔</param>
        public DropDownListPlusDrawItemBeforeEventArgs(float dpi, Graphics graphics, Rectangle clipContentBounds, DropDownListPlusItem item, bool selected, bool mouseEnter, Rectangle imageRectangle, Rectangle textRectangle, SolidBrush backBrush, SolidBrush foreBrush, Pen splitterPen)
        {
            this.dpi = dpi;
            this.graphics = graphics;
            this.clipContentBounds = clipContentBounds;
            this.item = item;
            this.mouseEnter = mouseEnter;
            this.selected = selected;
            this.imageRectangle = imageRectangle;
            this.textRectangle = textRectangle;
            this.backBrush = backBrush;
            this.foreBrush = foreBrush;
            this.splitterPen = splitterPen;
        }
    }

}
